﻿<?php

// Martin Laas - kursus1109

$number = $_POST['number'];     
if (isset($_POST['input'])) 
{ 
	if ($input < $number) 
	{         
		echo "Liiga väike";
	} 	
	elseif ($input > $number) 
	{      
		echo "Liiga suur";
	} 
	elseif ($input == $number) 
	{     
		echo "Täpselt õige!";
	}
} 
else 
{
	$number = rand(1,1000);   
}
?>
<form action="<?=$_SERVER['PHP_SELF'] ?>" method="post" name="guessinggame">
  <p>Number:
    <input name="input" type="text">
</p>
  <p>
    <input type="hidden" name="number" value="<? echo "$number" ?>">
</p>
  <p>      <input name="" type="submit" value="Paku">
    </p>
</form>